/*
 * Copyright 2002 Christopher L. Conway, Cheng-Hong Li and Megan Pengelly.
 *
 * This file is part of The Pencil Compiler.
 *
 * The Pencil Compiler is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * The Pencil Compiler is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with The Pencil Compiler; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

/* @author Megan Pengelly */
package math.petrinets.model;

import java.awt.Point;

import com.mxgraph.model.mxCell;
import com.mxgraph.model.mxGeometry;

public class Place{
	private int tokens ;
	private int bound ;
	private String name ;
	private Point coord;
	
	private mxCell cell;
	private int position;

	public Place() {
		this(0) ;
	}

	public Place(int t) {
		this(t,-1) ;
	}

	public Place(int t, int b) {
		tokens = t ;
		bound = b ;
		coord = new Point();
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setCoord(int x, int y) {
		coord.setLocation(x,y);
	}
	
	public Point getCoord() {
		return coord;
	}

	public void setBound(int bound){
		this.bound = bound;
	}

	public int getBound(){
		return bound;
	}
	
	public void setTokens(int tokens){
		System.out.println("current token " + getTokens());
		System.out.println("token " + tokens);
		this.tokens = tokens;
	}

	public int getTokens(){
		return tokens;
	}

	public int getPosition() {
		return position;
	}

	public void setPosition(int position) {
		this.position = position;
	}
	
	public void setCell(Object cell) {
		this.cell = (mxCell) cell;
	}
	
	public mxCell getCell() {
		return cell;
	}
}


